package com.xujie.sportsmeeting.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 赛事检录实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("event_checkin")
public class EventCheckin implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 检录ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 比赛项目ID
     */
    @NotNull(message = "比赛项目ID不能为空")
    @TableField("event_id")
    private Long eventId;

    /**
     * 报名记录ID
     */
    @NotNull(message = "报名记录ID不能为空")
    @TableField("registration_id")
    private Long registrationId;

    /**
     * 运动员ID
     */
    @NotNull(message = "运动员ID不能为空")
    @TableField("athlete_id")
    private Long athleteId;

    /**
     * 运动员姓名
     */
    @NotBlank(message = "运动员姓名不能为空")
    @TableField("athlete_name")
    private String athleteName;

    /**
     * 学号
     */
    @NotBlank(message = "学号不能为空")
    @TableField("student_number")
    private String studentNumber;

    /**
     * 参赛号
     */
    @TableField("race_number")
    private String raceNumber;

    /**
     * 检录状态 0-未检录 1-已检录 2-缺席
     */
    @TableField("checkin_status")
    private Integer checkinStatus;

    /**
     * 检录时间
     */
    @TableField("checkin_time")
    private LocalDateTime checkinTime;

    /**
     * 检录员
     */
    @TableField("checkin_operator")
    private String checkinOperator;

    /**
     * 签名图片地址或JSON数据
     */
    @TableField("signature_image_url")
    private String signatureImageUrl;

    /**
     * 备注
     */
    @TableField("notes")
    private String notes;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
